package com.Excise;

public class Mycalculate implements calculate {

  @Override
  public long fact(int m) {
    long sum;
    if (m < 0) {
      System.out.println("输入数必须为正整数");
    }
    if (m == 1) {
      return 1;
    } else {
      sum = m * fact(m - 1);
      return sum;
    }
  }

  @Override
  public long intPower(int m, int n) {
    long sum = 1;
    for (int i = 0; i < n; i++) {
      //
      sum = sum * m;
    }
    return sum;
  }

  @Override
  public boolean findFactor(int m, int n) {
    return m + n > 100;
  }

  public static void main(String[] args) {
    //
    Mycalculate mycalculate = new Mycalculate();
    System.out.println(mycalculate.fact(4));
    System.out.println(mycalculate.intPower(5, 3));
    System.out.println(mycalculate.findFactor(50, 10));
  }
}
